<!-- 提现 -->
<template>
	<view class="home">
		<view class="header">
			<view class="header_text">当前余额</view>
			<view class="header_bottom">
				<view class="">
					<image src="../../static/images/hb.png" mode="" class="header_img"></image>
				</view>
				<view class="header_right">
					<text class="header_num">{{Info.ktx}}</text>
					<text class="header_money">元</text>
				</view>
			</view>
			<view class="jilu" @click="tabPage()">交易记录</view>
		</view>
		<view class="text">累计到20元以上就可以提现到微信零钱</view>
		<view class="btn" @click="tixian(Info.ktx)">
			立即提现
			<image src="../../static/images/arrow03.png" mode="" style="width: 35rpx;height: 35rpx;margin-left: 15rpx;"></image>
		</view>
		<view class="">
			<image src="../../static/images/bg05.png" mode="aspectFit" style="width: 100%;height: 100rpx;"></image>
		</view>
		<view class="">
			<view class="list_header">
				<view class="list_line"></view>
				<view class="list_title">提现攻略</view>
			</view>
			<view class="list_type">
				<view class="type_title">步骤一：邀请好友，成为粉丝</view>
				<view class="type_list">
					<view class="type_meun">
						<image src="../../static/images/img01.png" mode=""></image>
						<text>转发给好友\n或朋友圈</text>
					</view>
					<u-icon name="arrow-right" color="#1a96ff" size="16"></u-icon>
					<view class="type_meun">
						<image src="../../static/images/img02.png" mode=""></image>
						<text>好友打开\n小程序</text>
					</view>
					<u-icon name="arrow-right" color="#1a96ff" size="16"></u-icon>
					<view class="type_meun">
						<image src="../../static/images/img03.png" mode=""></image>
						<text>锁定好友\n成为粉丝</text>
					</view>
				</view>
				<view class="type_title" style="margin-top: 30rpx;">步骤二：好友发起投票</view>
				<view class="type_list">
					<view class="type_meun">
						<image src="../../static/images/img04.png" mode=""></image>
						<text>好友在30天\n内发起投票</text>
					</view>
					<u-icon name="arrow-right" color="#1a96ff" size="16"></u-icon>
					<view class="type_meun">
						<image src="../../static/images/img05.png" mode=""></image>
						<text>每100人投票\n你可获得5元</text>
					</view>
					<u-icon name="arrow-right" color="#1a96ff" size="16"></u-icon>
					<view class="type_meun">
						<image src="../../static/images/img06.png" mode=""></image>
						<text>投票结束\n奖励结算</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { withdrawAPI,spokespersonAPI } from '@/api/user'
	export default {
		data() {
			return {
				Info:{},
				money:0.00
			}
		},
		mounted() {
			
		},
		onLoad(options) {
			this.getData()
		},
		onShow() {
			
		},
		methods:{
			tabPage(){
				uni.navigateTo({
					url:'./tradeAnnal'
				})
			},
			tixian(data){
				uni.showLoading({
					title:'提交中'
				})
				var that = this
				if(data == '0.00'){
					uni.showToast({
						title:'暂无可提现金额',
						icon:'none'
					})
				}else{
					var parmes = {
						token:uni.getStorageSync('accessToken'),
						money:data
					}
					withdrawAPI(parmes).then(res =>{
						if(res.code == 1){
							uni.showToast({
								title:'提现成功',
								icon:'none'
							})
							that.getData()
						}else{
							uni.showToast({
								title:res.msg,
								icon:'none'
							})
						}
					})
				}
				
			},
			getData(){
				var parems = {
					token:uni.getStorageSync('accessToken')
				}
				spokespersonAPI(parems).then(res =>{
					if(res.code == 1){
						this.Info = res.data
					}else{
						uni.showToast({
							title:res.msg,
							icon:'none'
						})
					}
				})
			},
		}
		
	}
</script>

<style scoped lang="scss">
	.home{
		padding: 0 30rpx;
		.header{
			box-shadow: 0 0 24rpx 0 rgba(0,0,0,0.08);
			border-radius: 20rpx;
			width: 100%;
			height: 180rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: column;
			position: relative;
			.header_text{
				font-size: 26rpx;
				color: #909193;
				margin-bottom: 15rpx;
			}
			.header_bottom{
				display: flex;
				align-items: center;
				justify-content: center;
				.header_img{
					width: 60rpx;
					height: 60rpx;
				}
				.header_right{
					display: flex;
					align-items: center;
					.header_num{
						font-size: 42rpx;
						color: #333;
						font-weight: bold;
					}
					.header_money{
						font-size: 30rpx;
						color: #333;
						font-weight: bold;
					}
				}
			}
		}
		.jilu{
			width: 180rpx;
			height: 55rpx;
			border-radius: 100rpx 0 0 100rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			font-size: 26rpx;
			color: #fff;
			background: #1a96ff;
			position: absolute;
			top: 15rpx;
			right: 0;
		}
		.text{
			font-size: 28rpx;
			color: #909193;
			margin: 30rpx 0 20rpx 0;
			text-align: center;
		}
		.btn{
			display: flex;
			align-items: center;
			justify-content: center;
			background: #3c9cff;
			font-size: 28rpx;
			color: #fff;
			border-radius: 100rpx;
			margin: 0 auto;
			width: 80%;
			height: 80rpx;
		}
		.list_header{
			display: flex;
			align-items: center;
			margin: 24rpx 0;
		}
		.list_line{
			width: 15rpx;
			height: 15rpx;
			border-radius: 50%;
			background:#1a96ff ;
		}
		.list_title{
			font-size: 28rpx;
			color: #303133;
			font-weight: bold;
			margin-left: 20rpx;
		}
		.list_type{
			border: 2rpx solid #eee;
			min-height: 72vw;
			border-radius: 10rpx;
			padding: 20rpx 30rpx;
		}
		.type_title{
			font-size: 28rpx;
			color: #333333;
		}
		.type_list{
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-top: 20rpx;
		}
		.type_meun{
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: column;
			image{
				width: 105rpx;
				height: 105rpx;
			}
			text{
				font-size: 28rpx;
				color:#333;
				text-align: center;
				margin-top: 10rpx;
			}
		}
	}
</style>